NSSet 排序
文章目录
NSSet 排序
nsset排序**
**
//如果想排序以后再取,可以这样:
NSSet
*users = [groupUser users];
NSSortDescriptor
*sd = [[NSSortDescriptor alloc] initWithKey: “displayName”
ascending:YES];
NSArray
*sortDescriptors = [NSArray arrayWithObjects:sd, nil];
NSArray
*userArray = [users
sortedArrayUsingDescriptors:sortDescriptors];
//如果直接取,可以这样:
NSArray
*userArray = [users allObjects];